<include file="public@head" />
</head>

<body>
    <div class="layui-fluid wrap" id="component-tabs">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">后台菜单管理</div>
                    <div class="layui-card-body">
                        <div class="layui-tab">
                            <ul class="layui-tab-title">
                                <li><a href="{:url('Menu/index')}">后台菜单</a></li>
                                <li><a href="{:url('Menu/add')}">添加菜单</a></li>
                                <li><a href="{:url('Menu/lists')}">所有菜单</a></li>
                                <li class="layui-this"><a href="{:url('Menu/edit')}">编辑菜单</a></li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <form method="post" class="layui-form js-ajax-form" action="{:url('menu/editPost')}">
                                        <div class="layui-form-item">
                                            <label for="input-parent_id" class="layui-form-label"><span style="color:#FF5722;">*</span>上级</label>
                                            <div class="layui-input-block">
                                                <select name="parent_id" id="input-parent_id">
                                                    <option value="0">作为一级菜单</option>{$select_category}
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-name" class="layui-form-label"><span style="color:#FF5722;">*</span>名称</label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-name" name="name" value="{$data.name}">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-app" class="layui-form-label"><span style="color:#FF5722;">*</span>应用</label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-app" name="app" value="{$data.app}">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-controller" class="layui-form-label"><span style="color:#FF5722;">*</span>控制器</label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-controller" name="controller" value="{$data.controller}">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-action" class="layui-form-label"><span style="color:#FF5722;">*</span>方法</label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-action" name="action" value="{$data.action}">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-param" class="layui-form-label">参数</label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-param" name="param" value="{$data.param}">
                                                <p class="help-block">例:id=3&amp;p=3</p>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-icon" class="layui-form-label">图标</label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-icon" name="icon" value="{$data.icon}">
                                                <p class="help-block">
                                                    <a href="http://www.thinkcmf.com/font/font_awesome/icons.html" target="_blank">选择图标</a> 不带前缀fa-，如fa-user => user
                                                </p>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-remark" class="layui-form-label">备注</label>
                                            <div class="layui-input-block">
                                                <textarea class="layui-textarea" id="input-remark" name="remark">{$data.remark}</textarea>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-status" class="layui-form-label">状态</label>
                                            <div class="layui-input-block" id="input-status">
                                                <select name="status">
                                                    <option value="1">在左侧菜单显示</option>
                                                    <php>$status_selected=empty($data['status'])?"selected":"";</php>
                                                    <option value="0" {$status_selected}>在左侧菜单隐藏</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-type" class="layui-form-label">类型</label>
                                            <div class="layui-input-block">
                                                <select name="type" id="input-type">
                                                    <option value="1">有界面可访问菜单</option>
                                                    <php>$type2_selected=$data['type']==2?"selected":"";</php>
                                                    <option value="2" {$type2_selected}>无界面可访问菜单</option>
                                                    <php>$type_selected=$data['type']==0?"selected":"";</php>
                                                    <option value="0" {$type_selected}>只作为菜单</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-form-item layui-layout-admin">
                                            <div class="layui-input-block">
                                                <div class="layui-footer" style="left:0;">
                                                    <input type="hidden" name="id" value="{$data.id}" />
                                                    <button type="submit" class="layui-btn js-ajax-submit">{:lang('SAVE')}</button>
                                                    <a class="layui-btn  layui-btn-primary" href="{:url('menu/index')}">{:lang('BACK')}</a>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <include file="public@footer" />
</body>

</html>